package main

import "fmt"

// 函数写法
/*
func 函数名(形参列表)(返回追列表){
	return 值
}
*/
type myint int

func getSum( a int, b int )int{
	return a+b
}
func exChangeValue(a *int,b *int){
	c:=*a
	*a=*b
	*b=c
	fmt.Printf("c的数据类型是%T \n",c)
	fmt.Println("指针",*a ,*b,)
}
//  age...int可以传入多个参数
func test(age...int){
	fmt.Println("结果",age)
}

func test02(num int,num2 float32,myfun func(int,int)int){
	fmt.Println("测试入参为函数")
}

func test03(num int,num1 int)(num2 int,num3 int){
	num2 =num+num1
	num3 =num-num1
	return
}

func main(){
	var num1 int =10
	var num2 int =11
	exChangeValue(&num1,&num2)
	test(1,2,3,4,5)
	fmt.Println("结果",num1,num2)
	fmt.Printf("test的类型:%T\n",test)
	test02(1,0.01,getSum)
   	v1,v2:=test03(50,30)
	fmt.Println("v1,v2结果",v1,v2)
}

